﻿/*
給 GameLevel 使用的 MyScene.
RELEASE 時清除數據及子物件.
*/
package com.cf.core.view{
	import flash.display.Sprite;
	import flash.events.Event;
	import com.cf.core.Utils.*;
	import com.cf.core.model.AutoDestorySprite;
	import flash.display.DisplayObjectContainer;

	public class MyScene extends AutoDestorySprite{
		private var G_var:cache;
		public function get VAR():Function { return G_var.address }
		public function MyScene():void{
			// 當被 baseInterface 建立時,
			// 嘗試取得 parent baseInterface 之 soundChannel :: 不用額外 preload
			this.name = "MyScene_"+ this.name;
			G_var=new cache();
		}//fn
		public function sync_var(_var:cache):void{
			// relative gameInterface, to sync all value form parent.
			try{
				G_var = _var;
				// removeEventListener(Event.REMOVED_FROM_STAGE, RELEASE);	// prevent active auto RELEASE
				trace("MyScene : "+this.name +" cache sync successful");
			}catch(e){ trace("MyScene : "+this.name +" cache sync FAIL"); }//try
		}//fn
	}//class
}//package